package map.data
{
	import flash.geom.Point;
	
	import map.geometry.RadLine;

	public class Obstacle
	{
		private var _line:RadLine;
		private var _weaken:Number=1;
		
		public function Obstacle(line:RadLine)
		{
			_line = line;
		}
		
		public function get length():Number
		{
			return _line.length;
		}
		
		public function eqaul(ob:Obstacle):Boolean
		{
			return _line.equal(ob.line);
		}
		
		public function set line(l:RadLine):void
		{
			
		}
		
		public function get line():RadLine
		{
			return _line;
		}
		
		public function get weaken():Number
		{
			return _weaken;
		}
		
		public function set weaken(value:Number):void
		{
			_weaken = value;
		}
		
		public static function decode(obj:Object):Obstacle
		{
			var l:RadLine = new RadLine(new Point(obj.line.p1.x,obj.line.p1.y),new Point(obj.line.p2.x,obj.line.p2.y));
			var result:Obstacle = new Obstacle(l);
			result.weaken = obj.weaken;
			return result;
		}

	}
}